from PyQt5.Qt import *
from PyQt5.QtWebEngineWidgets import *

class MyQWidget(QMainWindow):
    def __init__(self):
        super().__init__()
        self.setup_ui()

    def setup_ui(self):
        self.setWindowTitle("本地web页面")
        self.setGeometry(5, 30, 1355, 730)
        self.browser = QWebEngineView()
        url = r'E:/Workerspace_python/pyqt5/7.网页/index.html'
        self.browser.load(QUrl(url))
        self.setCentralWidget(self.browser)

# 测试
if __name__ == '__main__':
    import sys
    app = QApplication(sys.argv)
    window = MyQWidget()
    window.show()
    sys.exit(app.exec_())

